package com.tl.app.service.impl;

import java.util.List;
import com.tl.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tl.app.mapper.AppCarouselMapper;
import com.tl.app.domain.AppCarousel;
import com.tl.app.service.IAppCarouselService;

/**
 * 轮播Service业务层处理
 * 
 * @author suhp
 * @date 2024-06-21
 */
@Service
public class AppCarouselServiceImpl implements IAppCarouselService 
{
    @Autowired
    private AppCarouselMapper appCarouselMapper;

    /**
     * 查询轮播
     * 
     * @param carouselId 轮播主键
     * @return 轮播
     */
    @Override
    public AppCarousel selectAppCarouselByCarouselId(Long carouselId)
    {
        return appCarouselMapper.selectAppCarouselByCarouselId(carouselId);
    }

    /**
     * 查询轮播列表
     * 
     * @param appCarousel 轮播
     * @return 轮播
     */
    @Override
    public List<AppCarousel> selectAppCarouselList(AppCarousel appCarousel)
    {
        return appCarouselMapper.selectAppCarouselList(appCarousel);
    }

    /**
     * 新增轮播
     * 
     * @param appCarousel 轮播
     * @return 结果
     */
    @Override
    public int insertAppCarousel(AppCarousel appCarousel)
    {
        appCarousel.setCreateTime(DateUtils.getNowDate());
        return appCarouselMapper.insertAppCarousel(appCarousel);
    }

    /**
     * 修改轮播
     * 
     * @param appCarousel 轮播
     * @return 结果
     */
    @Override
    public int updateAppCarousel(AppCarousel appCarousel)
    {
        return appCarouselMapper.updateAppCarousel(appCarousel);
    }

    /**
     * 批量删除轮播
     * 
     * @param carouselIds 需要删除的轮播主键
     * @return 结果
     */
    @Override
    public int deleteAppCarouselByCarouselIds(Long[] carouselIds)
    {
        return appCarouselMapper.deleteAppCarouselByCarouselIds(carouselIds);
    }

    /**
     * 删除轮播信息
     * 
     * @param carouselId 轮播主键
     * @return 结果
     */
    @Override
    public int deleteAppCarouselByCarouselId(Long carouselId)
    {
        return appCarouselMapper.deleteAppCarouselByCarouselId(carouselId);
    }
}
